package 博客.工厂模式.工厂方法;

//汽车工厂接口
public interface CarFacory {
    public Car getCar();
}

//奥迪工厂
class AudiFactory implements CarFacory{
    public Car getCar() {
        return new Audi();
    }
}

//宝马工厂
class BMWFactory implements CarFacory{

    public Car getCar() {
        return new BMW();
    }
}

//奔驰工厂
class BenzFactory implements CarFacory{
    public Car getCar() {
        return new Benz();
    }
}

//莱斯老师工厂
class RollsRoyceFactory implements CarFacory{
    public Car getCar() {
        return new RollsRoyce();
    }
}
